package models;

import java.sql.ResultSet;
import java.sql.SQLException;

public class 
ShipItemModel 
extends AbstractModel
{	public boolean
	insert(Integer sid, Integer upc, Integer supPrice, Integer quantity)
	{	try{
			ps = con.prepareStatement("INSERT INTO ShipItem VALUES (?,?,?,?)");
			ps.setInt(1, sid);
			ps.setInt(2,upc);
			ps.setInt(3, supPrice);
			ps.setInt(4, quantity);
			return wrapUp();
		} catch(SQLException ex){ return registerException(ex); }
	}
	
	public boolean
	delete(int sid, int upc)
	{ 	try{
			ps = con.prepareStatement("DELETE FROM ShipItem WHERE sid = ? AND upc = ?");
			ps.setInt(1,sid);
			ps.setInt(2,upc);
			return wrapUp();
		} catch(SQLException ex){ return registerException(ex); }
	}
	
	public ResultSet
	show()
	{ return super.show("ShipItem"); }
}
